<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>使用id来绑定页面dom，引入echart</title>
</head>

<body>
    <script src="https://cdn.jsdelivr.net/npm/echarts@5.4.0/dist/echarts.js"></script>
    <div id="Application">
        <!-- 为 ECharts 准备一个定义了宽高的 DOM -->
        <div style="width: 600px; height: 400px" id="refChart"></div>
    </div>

    <script type="text/javascript">

        //展示图表
        //	此dom为echarts图标展示dom
        //展示表格
        const showChat = () => {
            // 基于准备好的dom，初始化echarts实例
            const myChart = echarts.init(document.getElementById('refChart'));

            // 指定图表的配置项和数据
            const option = {
                title: {
                    text: "ECharts 入门示例",
                },
                tooltip: {},
                legend: {
                    data: ["作者一"],
                },
                xAxis: {
                    data: ["周一", "周二", "周三", "周四", "周五", "周六", "周七"],
                },
                yAxis: {},
                series: [
                    {
                        name: "作者一",
                        type: "bar",
                        data: [55, 22, 16, 18, 30, 22, 26],
                    },
                ],
            };
            // 使用刚指定的配置项和数据显示图表。
            myChart.setOption(option);
        }
        showChat();
    </script>
</body>

</html>